package com.ys.filelib.filedialog;

import android.content.Context;
import android.view.View;

import com.ys.filelib.databinding.FilelibDialogTipBinding;

class TipDialog extends MyDialog {
    private FilelibDialogTipBinding mView;

    public TipDialog(Context context) {
        super(context);
        mView = FilelibDialogTipBinding.inflate(getInflater());
    }

    @Override
    protected View getView() {
        initView();
        return mView.getRoot();
    }

    private void initView() {
        mView.tvCancel.setOnClickListener(v -> {
            dismiss();
        });
    }

    public void setTitle(String title) {
        this.mView.tvTitle.setText(title);
    }

    public void setContent(String content) {
        this.mView.tvContent.setText(content);
    }

    public void setOnSureListener(View.OnClickListener listener) {
        mView.tvOk.setOnClickListener(listener);
    }

    @Override
    protected void onStart() {
        super.onStart();
//        WindowManager.LayoutParams lp = getWindow().getAttributes();
//        lp.gravity = Gravity.TOP;
//        lp.y = 400;
    }
}
